import request from '../utils/request';
let proUrl=""  // https://rongxiaozhang.renheyurong.cn

export {proUrl};
//登录
export const login = query => {

    return request({
        url: proUrl+'/backstage/api/login/',
        method: 'POST',
        data: query
    });
};
//修改密码
export const edictUser =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/backstageuser/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};


// 宣传配置
export const xuanchuanList = query => {
    return request({
        url: proUrl+'/backstage/api/xuanchuan/',
        method: 'get',
        params: query
    });
};
// 宣传配置（修改）
export const xuanchuanEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/xuanchuan/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};


// 产品列表（新增）
export const chanpinAdd = query => {
    return request({
        url: proUrl+'/backstage/api/chanpin/',
        method: 'POST',
        data: query
    });
};
// 产品列表（获取）
export const chanpinList = query => {
    return request({
        url: proUrl+'/backstage/api/chanpin/',
        method: 'get',
        params: query
    });
};
// 产品列表（修改）
export const chanpinEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/chanpin/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
// 产品列表（删除）
export const chanpinDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/chanpin/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};


// 配置管理
export const peizhiList = query => {
    return request({
        url: proUrl+'/backstage/api/config/',
        method: 'get',
        params: query
    });
};
// 配置管理（修改）
export const peizhiEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/config/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 等级配置
export const dengjiList = query => {
    return request({
        url: proUrl+'/backstage/api/dengji/',
        method: 'get',
        params: query
    });
};
// 等级配置（修改）
export const dengjiEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/dengji/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 客户分享配置
export const fenxiangpeizhiList = query => {
    return request({
        url: proUrl+'/backstage/api/fenxiangpeizhi/',
        method: 'get',
        params: query
    });
};
// 客户分享配置（修改）
export const fenxiangpeizhiEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/fenxiangpeizhi/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 简介配置
export const jianjiepeizhiList = query => {
    return request({
        url: proUrl+'/backstage/api/jianjiepeizhi/',
        method: 'get',
        params: query
    });
};
// 简介配置（修改）
export const jianjiepeizhiEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/jianjiepeizhi/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 介绍人返点配置
export const jieshaorenfandianList = query => {
    return request({
        url: proUrl+'/backstage/api/jieshaorenfandian/',
        method: 'get',
        params: query
    });
};
// 介绍人返点配置（修改）
export const jieshaorenfandianEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/jieshaorenfandian/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 说明配置
export const shuomingList = query => {
    return request({
        url: proUrl+'/backstage/api/shuoming/',
        method: 'get',
        params: query
    });
};
// 说明配置（修改）
export const shuomingEdict =  (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/shuoming/'+backstage_user_id+'/',   
        method: 'put',
        data: query
    });
};

// 介绍人返点兑换
export const jieshaorenduihuanList = query => {
    return request({
        url: proUrl+'/backstage/api/jieshaorenduihuan/',
        method: 'get',
        params: query
    });
};
// 介绍人返点兑换
export const jieshaorenduihuanAdd = query => {
    return request({
        url: proUrl+'/backstage/api/jieshaorenduihuan/',
        method: 'POST',
        data: query
    });
};




// 期刊与爬虫文件名对照表
export const journalsandreptilesAdd = query => {
    return request({
        url: proUrl+'/backstage/api/journalsandreptiles/',
        method: 'POST',
        data: query
    });
};
//期刊与爬虫文件名对照表
export const journalsandreptilesList = query => {
    return request({
        url: proUrl+'/backstage/api/journalsandreptiles/',
        method: 'get',
        params: query
    });
};

//期刊与爬虫文件名对照表（编辑）
export const journalsandreptilesEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/journalsandreptiles/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//期刊与爬虫文件名对照表（删除）
export const journalsandreptilesDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/journalsandreptiles/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};


// 期刊文献
export const journalAdd = query => {
    return request({
        url: proUrl+'/backstage/api/journal/',
        method: 'POST',
        data: query
    });
};
//期刊文献
export const journalList = query => {
    return request({
        url: proUrl+'/backstage/api/journal/',
        method: 'get',
        params: query
    });
};

//期刊文献（编辑）
export const journalEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/journal/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//期刊文献（删除）
export const journalDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/journal/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};


//公告管理（新增）
export const gonggaoAdd = query => {
    return request({
        url: proUrl+'/backstage/api/notice/',
        method: 'POST',
        data: query
    });
};
//公告管理
export const gonggaoList = query => {
    return request({
        url: proUrl+'/backstage/api/notice/',
        method: 'get',
        params: query
    });
};

//公告管理（编辑）
export const gonggaoEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/notice/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//公告管理（删除）
export const gonggaoDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/notice/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};

//轮播管理（新增）
export const bannerAdd = query => {
    return request({
        url: proUrl+'/backstage/api/banner/',
        method: 'POST',
        data: query
    });
};
//轮播管理
export const bannerList = query => {
    return request({
        url: proUrl+'/backstage/api/banner/',
        method: 'get',
        params: query
    });
};

//轮播管理（编辑）
export const bannerEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/banner/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//轮播管理（删除）
export const bannerDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/banner/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};


// 客户返点配置
export const fandianpeizhiList = query => {
    return request({
        url: proUrl+'/backstage/api/fandianpeizhi/',
        method: 'get',
        params: query
    });
};

//客户返点配置（新增）
export const fandianpeizhiAdd = query => {
    return request({
        url: proUrl+'/backstage/api/fandianpeizhi/',
        method: 'POST',
        data: query
    });
};
//客户返点配置（编辑）
export const fandianpeizhiEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/fandianpeizhi/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//客户返点配置（删除）
export const fandianpeizhiDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/fandianpeizhi/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};


//客户数据管理
export const userList = query => {
    return request({
        url: proUrl+'/backstage/api/user/',
        method: 'get',
        params: query
    });
};
//客户数据管理（新增）
export const userAdd = query => {
    return request({
        url: proUrl+'/backstage/api/user/',
        method: 'POST',
        data: query
    });
};
//客户数据管理（编辑）
export const userEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/user/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//客户数据管理（删除）
export const userDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/user/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};

// 客户数据管理(导出)
export const user_export_excel = query => {
    return request({
        url: proUrl+'/backstage/api/user/export_excel/',
        method: 'get',
        params: query
    });
};

// 客户数据管理(修改拿货总金额)
export const update_nahuo = query => {
    return request({
        url: proUrl+'/backstage/api/user/update_nahuo/',
        method: 'POST',
        data: query
    });
};



// //员工管理（批量删除）
// export const userbatch_delete = query => {
//     return request({
//         url: proUrl+'/backstage/api/user/batch_delete/',
//         method: 'POST',
//         data: query
//     });
// };


//角色下拉
export const roledropdown = query => {
    return request({
        url: proUrl+'/backstage/api/roledropdown/',
        method: 'get',
        params: query
    });
};


//报单审核接口
export const examine = query => {
    return request({
        url: proUrl+'/backstage/api/report/examine/',
        method: 'POST',
        data: query
    });
};

//用户审核统计
export const calculationview = query => {
    return request({
        url: proUrl+'/backstage/api/calculationview/',
        method: 'get',
        params: query
    });
};

//个人中心
export const myuserList = query => {
    return request({
        url: proUrl+'/backstage/api/myuser/',
        method: 'get',
        params: query
    });
};

//个人中心修改
export const myuserEdict = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/myuser/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};

//用户管理（批量删除）
export const batch_delete = query => {
    return request({
        url: proUrl+'/backstage/api/userview/batch_delete/',
        method: 'POST',
        data: query
    });
};

//用户管理（批量导出）
export const export_excel_user = query => {
    return request({
        url: proUrl+'/backstage/api/userview/export_excel/',
        method: 'POST',
        data: query
    });
};

//公告获取
export const noticeviewList = query => {
    return request({
        url: proUrl+'/backstage/api/noticeview/',
        method: 'get',
        params: query
    });
};

//公告修改
export const noticeviewEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/noticeview/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};

//期数配置管理
export const periodsviewList = query => {
    return request({
        url: proUrl+'/backstage/api/periodsview/',
        method: 'get',
        params: query
    });
};

//期数配置（编辑）
export const periodsviewEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/periodsview/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};




//获取当前年月
export const gettoday = query => {
    return request({
        url: proUrl+'/backstage/api/gettoday/',
        method: 'get',
        params: query
    });
};

//数据导出
export const export_excel = query => {
    return request({
        url: proUrl+'/backstage/api/export_excel/',
        method: 'POST',
        data: query
    });
};

//批量删除(数据)
export const delete_data = query => {
    return request({
        url: proUrl+'/backstage/api/dataview/delete_data/',
        method: 'POST',
        data: query
    });
};

//批量修改（模板详情）
export const batch_update = query => {
    return request({
        url: proUrl+'/backstage/api/templateinfoview/batch_update/',
        method: 'POST',
        data: query
    });
};

//打卡管理 批量删除
export const dynamicviewBatch_delete = query => {
    return request({
        url: proUrl+'/backstage/api/dynamicview/batch_delete/',
        method: 'POST',
        data: query
    });
};



//导出
// /backstage/api/user/export_excel/


//上传图片
export const uploadImg = query => {
    return request({
        url: proUrl+'/backstage/api/upload_image/',
		headers:{
			'Content-Type': 'application/json' 
		},
        method: 'post',
        data: query
    });
};

//上传exel
export const uploadExcel = query => {
    return request({
        url: proUrl+'/backstage/api/upload_image/',
		headers:{
			'Content-Type': 'application/json' 
		},
        method: 'POST',
        data: query
    });
};
export const add_data = query => {
    return request({
        url: proUrl+'/backstage/api/add_data/',
        method: 'POST',
        data: query
    });
};



//账号管理
export const lbackstageuserviewList = query => {
    return request({
        url: proUrl+'/backstage/api/v2bckstageuser/',
        method: 'get',
        params: query
    });
};

//账号管理（新增）
export const lbackstageuserviewAdd = query => {
    return request({
        url: proUrl+'/backstage/api/v2bckstageuser/',
        method: 'POST',
        data: query
    });
};
//账号管理（编辑）
export const lbackstageuserviewEdict = (backstage_user_id,query) => {
	console.log("jiekou",backstage_user_id,query)
    return request({
        url: proUrl+'/backstage/api/v2bckstageuser/'+backstage_user_id+'/',
        method: 'PUT',
        data: query
    });
};
//账号管理（删除）
export const lbackstageuserviewDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/v2bckstageuser/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};

//个人报单记录（批量删除）
export const myreportbatch_delete = query => {
    return request({
        url: proUrl+'/backstage/api/myreport/batch_delete/',
        method: 'POST',
        data: query
    });
};

//报单管理（批量删除）
export const reportbatch_delete = query => {
    return request({
        url: proUrl+'/backstage/api/report/batch_delete/',
        method: 'POST',
        data: query
    });
};


//用户管理
export const userviewsetList = query => {
    return request({
        url: proUrl+'/backstage/api/userview/',
        method: 'get',
        params: query
    });
};
//用户管理（新增）
export const userviewsetAdd = query => {
    return request({
        url: proUrl+'/backstage/api/userview/',
       method: 'POST',
       data: query
    });
};
//用户管理（编辑）
export const userviewsetEdict = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/userview/'+backstage_user_id+'/',
       method: 'PUT',
       data: query
    });
};
//用户管理（删除）
export const userviewsetDelete = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/userview/'+backstage_user_id+'/',
      method: 'DELETE',
      data: query
    });
};

//数据视图（新增）
export const dataviewAdd = query => {
    return request({
        url: proUrl+'/backstage/api/dataview/',
        method: 'post',
        data: query
    });
};

//会员管理接口（新增）
export const userviewsetListAdd = query => {
    return request({
        url: proUrl+'/backstage/api/userviewset/',
        method: 'post',
        data: query
    });
};
//会员管理接口（修改）
export const userviewsetListEdict = (backstage_user_id,query) => {
    return request({
        url: proUrl+'/backstage/api/userviewset/'+backstage_user_id+'/',
       method: 'PUT',
       data: query
    });
};
//会员管理接口（删除）
export const userviewsetListDelete = (backstage_user_id,query) => {
    return request({
        url:proUrl+ '/backstage/api/userviewset/'+backstage_user_id+'/',
       method: 'DELETE',
       data: query
    });
};


